from appium.webdriver.webdriver import WebDriver


class Base:
    """
    将公共的部分放入base类中，在别的类中直接继承就可以了
    将公共部分封装成方法，再在别的类中引用即可
    """
    def __init__(self,driver:WebDriver):
        self.driver = driver

    def swipe_down(self):
        size = self.driver.get_window_size()
        width = size.get('width')
        height = size.get('height')
        start_width = width*0.5
        start_height = height*0.25
        end_width = width*0.5
        end_height = height*0.75
        self.driver.swipe(start_width,start_height,end_width,end_height,1000)


